window.onload = function(){
	var num = 0;
    function method(num) {
        var a = document.getElementsByClassName('hdt_ul_li');
    	for (var i = 0; i < a.length; i++) {
        	a[i].style.display = 'none';
        }
        a[num].style.display = "";
    }
    function run(){
    	if (num==4) {
    		num = 0;
    	}else{
    		num++;
    	}
        method(num);
        function runnew(){
        if (num==0) {
            num = 4;
        }else{
            num--;
        }
        method(num);

    }
    var tim = setInterval(run,2000);
    var hdt_ul = document.getElementById("hdt_ul");
    hdt_ul.onmouseover = function(){
	clearInterval(tim);
    }
    hdt_ul.onmouseleave = function(){
    	tim = setInterval(run,2000);
    }
    var kuai=document.getElementsByClassName('kuai');
    for (var i=0;i<kuai.length;i++) {
        main(i);
    };

    function main(i){
        kuai[i].onclick=function(){
            num=i;
            run();
        }     
    }
    var bottn_l = document.getElementById('bottn_left');
    var bottn_r = document.getElementById('bottn_right');
    bottn_l.onclick=function(){
        runnew();
    }
    bottn_r.onclick=function(){
        run();
    }  
}